
#include "ConversionFunction.hpp"

Fraction::Fraction(double member, double denominator) : m_member(member), m_denominator(denominator) {}

Fraction Fraction::operator+(const Fraction &f) 
{
    double this_member = this->m_member * f.m_denominator;
    double this_denominator = this->m_denominator * f.m_denominator;

    double that_member = f.m_member * this->m_denominator;
    double that_denominator = f.m_denominator * this->m_denominator;

    return Fraction(this_member + that_member,  that_denominator);
}

std::ostream &operator<<(std::ostream &out, Fraction &f)
{
    out << (f.m_member / f.m_denominator);
}